package com.moli.iov.protocol.model;



/*
 * 文件名： VehicleLogoutData.java
 * 
 * 创建日期： 2016年11月25日
 *
 *
 */

import java.io.Serializable;

import com.moli.iov.protocol.codec.DataDecoder;
import com.moli.iov.protocol.codec.Serialize;
import com.moli.iov.protocol.enums.DateTimeTag;

/**
 * 车辆登出
 *
 * @version $Revision$
 *
 * @since 2016年11月25日
 */
@Serialize(unit="byte",isBigEndian=true)
public class VehicleLogoutReq extends Header implements Serializable {

	/** 
	*/
	public static final long serialVersionUID = 1L;

	/**
	 * 车辆登出时间
	 */
	@Serialize(unit="byte",offset=header_offset+0,size=6)
	public DateTimeTag logoutDate;
	
	/**
	 * 车辆登出流水号
	 */
	@Serialize(unit="byte",offset=header_offset+6,size=2)
	public short logoutSerNum;

	 /**
	 *
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("VehicleLogoutReq [logoutDate=");
		builder.append(logoutDate);
		builder.append(", logoutSerNum=");
		builder.append(logoutSerNum);
		builder.append("]");
		return builder.toString();
	}




	public static void main(String[] args) {
		byte[] bytes = new byte[]
				{ 0x23,0x23,0x04,(byte)0xfe,0x4c,0x4c,0x56,0x32,0x41,0x52,0x42,0x32,0x35,0x47,0x38,0x30,0x30,0x30,0x30,0x31,0x32,0x01,0x00,0x08,0x11,0x02,0x11,0x0f,0x2d,0x2f,0x00,0x16,(byte)0xb2 };
		VehicleLogoutReq vehicleLogoutData = new VehicleLogoutReq();
			DataDecoder<VehicleLogoutReq> decoder = new DataDecoder<>();
			try {
				decoder.decode(vehicleLogoutData, bytes);
			}
			catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			System.out.println("---"+vehicleLogoutData.toString());
	}
}
